<?php

namespace Common\Model;

use Think\Model;

class BaseModel extends Model {

  public function __construct($name = '', $tablePrefix = '', $connection = '') {
    parent::__construct($name, $tablePrefix, $connection);
  }
  
  /**
   * 获取ajax分页与正常分页
   * @param type $last 每页显示条数
   * @return array 
   */
  public function getPageInfo($last=0,$count=0) {
    $listNum = C('LISTNUMBER');
    if($last == 0){
      $Page = new \Think\Page($count, $listNum);
      $page = $Page->show();
      $last=$Page->firstRow;
    }else{
      $page='';
    }
    return array('page'=>$page,'last'=>$last,'listNum'=>$listNum);
  }

}
